﻿using System;
using System.Collections;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //for (int i = 0; i < 50; i++)
        //{
        //    NewsArticle n = new NewsArticle();
        //    n.Article = "test article content test article content test article content test article content test article content test article content test article content test article content test article content test article content test article content ";
        //    n.Date = DateTime.Now.ToLongTimeString();
        //    n.Name = "random headline";
        //    n.Source = "usa today";
        //    n.Add();
        //}

        //for (int i = 0; i < 50; i++)
        //{
        //    Product p = new Product();
        //    p.Model = "test model";
        //    p.Price = 15;
        //    p.Add();
        //}

        Response.Write(NewsArticle.FindFirst().Name + "<BR><BR>");
        Response.Flush();
        
        foreach (NewsArticle n in NewsArticle.Find(1, 10))
        {
            Response.Write(n.Name + "<BR>");
            Response.Flush();
        }
        Response.Write("<BR><BR>");

        foreach (NewsArticle n in NewsArticle.FindAll())
        {
            Response.Write(n.Name + "<BR>");
            Response.Flush();
        }
        Response.Write("<BR><BR>");
        
        foreach (Product p in Product.Find(1, 10))
        {
            Response.Write(p.Price + "<BR>");
            Response.Flush();
        }
        Response.Write("<BR><BR>");

    }
}
